﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Shop.Intermediate.Data;
using Shop.Core;
using DoNet.Common.Utilities;

namespace Shop.WebApp.SysBase
{
    public partial class DepartmentList :BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                gvList.DataSource = GetData();
                gvList.DataBind();
            }
            catch(Exception ex)
            {
                ProcessUnhandledException(ex);
            }
        }

        private IEnumerable<IDepartment> GetData()
        {
            DepartmentCore dpt = new DepartmentCore();
            return dpt.GetList();
        }
    }
}
